package com.niit.beans;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestLifeCycle {
    public static void main(String[] args) {

        ClassPathXmlApplicationContext ctx =
                new ClassPathXmlApplicationContext(
                        "spring-beans.xml");

        Game game = ctx.getBean(Game.class);
        game.play();
        ctx.close(); // 关闭IoC容器,自动销毁bean
    }
}
